#include "los_bsp_key.h"

/******************************************************************************
    here include some special hearder file you need
******************************************************************************/
#ifdef LOS_NUC472H
#include "NUC472_442.h"
#include "gpio.h"
#endif



/*****************************************************************************
 Function    : LOS_EvbKeyInit
 Description : Init GIOP Key
 Input       : None
 Output      : None
 Return      : None
 *****************************************************************************/
void LOS_EvbKeyInit(void)
{
    //add you code here.

#ifdef LOS_NUC472H
    GPIO_SetMode(PIN_KEY1, BIT_KEY1, GPIO_MODE_QUASI);
    PIN_KEY1->DOUT |= 0X1000;   /* res pull up */
#endif
    return;
}

/*****************************************************************************
 Function    : LOS_EvbGetKeyVal
 Description : Get GIOP Key value
 Input       : None
 Output      : None
 Return      : None
 *****************************************************************************/
unsigned int LOS_EvbGetKeyVal(int KeyNum)
{
    unsigned int KeyVal = LOS_GPIO_ERR;
    
    //add you code here.
#ifdef LOS_NUC472H
    if(0 == KeyNum)
    {
        if (0 == KEY1_STATE)
        {
            KeyVal = 0;
        }
        else
        {
            KeyVal = 1;
        }
    }
#endif
    
    return KeyVal;
}

/*****************************************************************************
 Function    : EXTIxxx_IRQHandler
 Description : EXT xxx IRQ Handler detail,change the function name
 Input       : None
 Output      : None
 Return      : None
 *****************************************************************************/
void EXTIxxx_IRQHandler(void)
{
    //add you code here.
    
    return;
}



